package com.hz.house.enums;

/**
 * 买房必读文章类型
 */
public enum ArticleTypeEnum {
    HOUSE_NEWS(1, "房产新闻"),

    ALONE_REPORT(2, "独家报道"),

    MARKET_POLICY(3, "楼市政策"),

    LAND_MARKET(4, "土地市场"),

    MANUSCRIPT(5,"楼盘资讯");

    private Integer type;

    private String name;

    ArticleTypeEnum(Integer type, String name) {
        this.type = type;
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    /***
     * 根据标签的type获取标签
     * @param type
     * @return
     */
    public static ArticleTypeEnum getTagByType(int type) {
        for (ArticleTypeEnum t : ArticleTypeEnum.values()) {
            if (t.getType() == type)
                return t;
        }
        return null;
    }
}
